﻿@using X.PagedList;
@using X.PagedList.Mvc.Core
@using X.PagedList.Mvc.Common
@using OpenMms.Domain.Models
@model IPagedList<UserUpgrade>
@if (Model.Count > 0)
{
    <div id="myDIV">
        <div class="table-responsive">
            <table class="table table-bordered table-striped">
                <tr>
                    @*<th>序号</th>*@
                    <th>会员编号</th>
                    <th>原级别</th>
                    <th>升级为</th>
                    <th>时间</th>
                    <th>审核状态</th>
                </tr>
                @*@{int i = 0;}*@
                @foreach (var item in Model)
                {

                    <tr>
                        @*<td>@(Model. + i++)</td>*@
                        <td>@item.UserCode</td>
                        <td>
                            @switch (item.NowLevel)
                            {
                                case 1:<p>一级会员</p>; break;
                                case 2:<p>二级会员</p>; break;
                                case 3:<p>三级会员</p>; break;
                                default:<p>无</p>; break;
                            }
                        </td>
                        <td>
                            @switch (item.AfterLevel)
                            {
                                case 1:<p>一级会员</p>; break;
                                case 2:<p>二级会员</p>; break;
                                case 3:<p>三级会员</p>; break;
                                default:<p>无</p>; break;
                            }
                        </td>
                        <td>@item.UpgradeDate</td>
                        <td>
                            @if (item.UpgradeState == 0)
                            {
                                <p>待审核</p>
                            }
                            else
                            {
                                <p>已审核</p>
                            }
                        </td>
                    </tr>
                }
            </table>
        </div>
    </div>
}
else
{
    <tr><td>暂无相关记录</td></tr>
}
@if (Model.Count > 0)
{
    @Html.PagedListPager(Model, pageIndex => Url.Action("List", new { pageIndex }), PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(new PagedListRenderOptions { MaximumPageNumbersToDisplay = 5, LinkToPreviousPageFormat = "上一页", LinkToNextPageFormat = "下一页", UlElementClasses = new[] { "pagination" }, ContainerDivClasses = new[] { "pagination-container" } }, new AjaxOptions() { HttpMethod = "GET", UpdateTargetId = "showPage" }))
}

